package com.example.demo.study.thread.volatileTry;

public class Task implements Runnable{
     boolean stop = false;
    long i = 0;

    @Override
    public void run() {
        long s = System.currentTimeMillis();
        while (!stop) {
            i++;
        }
        System.out.println("线程退出:" + (System.currentTimeMillis() - s));
    }
}
